var helloArea = $('#helloWorld');
helloArea.livequery('mouseover', function(e) {
    $(this).css("display","none");
});

var usrPhoto = $('#reserveInfo #requestForm');
usrPhoto.livequery('mouseup', function(e) {
    alert('ss');
    //alert($(this).parent().find('#restId').val());
    $("body #reserveInfo div .usrPhoto").removeClass("clicked");
    $(this).addClass("clicked");
    //$("#selectRestId").val($(this).parent().find('#restId').val());
});

var restPhoto = $('.restPhoto');
restPhoto.livequery('mouseup', function(e) {
    //alert($(this).parent().find('#restId').val());
    $("body #container #main div .restPhoto").removeClass("clicked");
    $(this).addClass("clicked");
    $("#selectRestId").val($(this).parent().find('#restId').val());
});

function disp_text()
{
    var w = document.myform.mylist.selectedIndex;
    var selected_text = document.myform.mylist.options[w].text;
    $.post("index.jsp", {"style": selected_text},
                function(data){
                    //$("#test").html(data);
                });

    return false;
}

$(function() {
	$( "#datepicker" ).datepicker();
});

function reserveRest() {
    $selectedTime = $("#Time").val();
    $selectedMonth = $("#orderdate_Month_ID").val();
    $selectedDay = $("#orderdate_Day_ID").val();
    $selectedYear = $("#orderdate_Year_ID").val();
    $selectedDate = $selectedYear+"/"+$selectedMonth+"/"+$selectedDay;
    $selectedRest = $("#restId").val();
    $.ajax( {
      url: "http://sexy4foodmate.dyndns-ip.com:8080/FoodMateService-war/reserveServlet",
      data: "reserve=aa&selectTime="+$selectedTime+"&selectDate="+$selectedDate+"&selectRest="+$selectedRest+"",
      success: function(data) {
         // alert(data);
        $("#reserveInfo").html(data)
      }
    })
}

function checkDate(date) {
    $selectedTime = $("#Time").val();
    $selectedMonth = $("#orderdate_Month_ID").val();
  /*  $yourInt;
    $yourInt = parseInt($selectedMonth);
    $yourIntA = $yourInt+1;
    $selectedMonth = num.toString(yourIntA);*/
    $selectedDay = $("#orderdate_Day_ID").val();
    $selectedYear = $("#orderdate_Year_ID").val();
    $selectedDate = $selectedYear+"/"+$selectedMonth+"/"+$selectedDay;
    $selectedRest = $("#restId").val();
    //alert($selectedTime);
    //alert($selectedDate);
    //alert($selectedRest);
    /*$.post("reserveServlet", {selectTime:$selectedTime, selectDate:$selectedDte}, function(xml) {
                alert("SS");
               $("#reserveInfo").html($("report", xml).text());
            });*/
    $.ajax( {
      //type: "GET",       // the default
      url: "http://sexy4foodmate.dyndns-ip.com:8080/FoodMateService-war/reserveServlet",
      data: "reserve=nn&selectTime="+$selectedTime+"&selectDate="+$selectedDate+"&selectRest="+$selectedRest+"",
      success: function(data) {
        $("#reserveInfo").html(data)
      }
    })

}


